/*
该文件专门在Count组件生成action对象
*/

import { INCREMENT,DECREMENT } from "../constant";
//同步action
export const createIncrementAction = data => ({type:INCREMENT,data})
export const createDecrementAction = data => ({type:DECREMENT,data})
//异步action，就是支action的值为函数，异步action种一般都会调佣同步action
export const createIncrementAsyncAction = (data,time) => {
    console.log(time);
    return (dispatch)=>{
        setTimeout(()=>{
            dispatch(createIncrementAction(data))
        },time)
    }
}

